const enterpriseVue = new Vue({
  el: '#app',
  data() {
    return {
      form:{
        Data:'enterprise_info',
        page:1,
        limit:10,

      },
      tableData:[],
      total: 0,
      loading:false,
    }
  },
  mounted() {
    if($.cookie('enterprise')!='1'){
      this.form.Primary_Key=$.cookie('enterprise')
      this.form.Primary_Key_Name='Enterprise_Info_SerialNumber'
    }
    this.getList(this.form)
  },
  methods: {
    onSerach(){

    },
    handle(a){
      window.location.href = './Business2.html'
    },
    handleSizeChange(val) {
      this.form.page = 1;
      this.form.limit = val;
      this.getList(this.form)
    },
    handleCurrentChange(val) {
      this.form.page = val;
      this.getList(this.form)
    },
    getList(data){
      $.ajax({
        type: 'POST',
        url: `${DomainName}/getTableInquiryAction?token=${$.cookie("token")}`,
        data,
        success: (Result)=> {
          if (Result.Status == 'success') {
            this.tableData = Result.tableData.filter(item=>item.Enterprise_Info_SerialNumber!='1')
            this.total = parseInt(Result.limit)
            console.log(Result);
          }
        },
        complete: (XMLHttpRequest) =>{
          this.loading = false;
          if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
          }
        },
        dataType: "json"
      });
    },

  }
})